Tables [dbo].[ContactMain]
Properties
PropertyValue
Created10:31:17 AM Tuesday, March 02, 2010
Last Modified4:07:25 PM Wednesday, February 29, 2012
Columns
NameData TypeMax Length (Bytes)Allow NullsDefault
Cluster Primary Key PK_ContactMain: ContactKeyForeign Keys FK_ContactMain_UniformRegistry: [dbo].[UniformRegistry].ContactKeyIndexes IX_ContactMain_IsInstitute: ContactKey\SyncContactID\ID\IsInstituteContactKeyuniqueidentifier16
No
Foreign Keys FK_ContactMain_ContactStatusRef: [dbo].[ContactStatusRef].ContactStatusCodeIndexes IX_ContactMain_ContactStatusCode: ContactStatusCodeContactStatusCodenvarchar(2)4
No
Indexes IX_ContactMain_FullName: FullNameFullNamenvarchar(110)220
No
Indexes IX_ContactMain_SortName: SortNameSortNamenvarchar(110)220
No
Indexes IX_ContactMain_IsInstitute: ContactKey\SyncContactID\ID\IsInstituteIsInstitutebit1
No
Indexes IX_ContactMain_TaxIDNumber: TaxIDNumberTaxIDNumbernvarchar(12)24
Yes
NoSolicitationFlagbit1
No
Indexes IX_ContactMain_IsInstitute: ContactKey\SyncContactID\ID\IsInstituteIndexes IX_ContactMain_SyncContactID: SyncContactIDSyncContactIDvarchar(20)20
Yes
UpdatedOndatetime8
No
(getdate())
Foreign Keys FK_ContactMain_UserMain_UpdatedBy: [dbo].[UserMain].UpdatedByUserKeyIndexes IX_ContactMain_UpdatedByUserKey: UpdatedByUserKeyUpdatedByUserKeyuniqueidentifier16
No
IsIDEditablebit1
Yes
Indexes IX_ContactMain_IsInstitute: ContactKey\SyncContactID\ID\IsInstituteIndexes IX_ContactMain_ID: IDIDnvarchar(12)24
Yes
Foreign Keys FK_ContactMain_AddressCategoryRef_Preferred: [dbo].[AddressCategoryRef].PreferredAddressCategoryCodePreferredAddressCategoryCodeint4
No
IsSortNameOverriddenbit1
No
((0))
Foreign Keys FK_ContactMain_GroupMain_PrimaryMembership: [dbo].[GroupMain].PrimaryMembershipGroupKeyIndexes AK_ContactMain_PrimaryMembershipGroupKey: PrimaryMembershipGroupKeyPrimaryMembershipGroupKeyuniqueidentifier16
Yes
Indexes IX_ContactMain_MajorKey: MajorKeyMajorKeynvarchar(30)60
Yes
Foreign Keys FK_ContactMain_AccessMain: [dbo].[AccessMain].AccessKeyIndexes IX_ContactMain_AccessKey: AccessKeyAccessKeyuniqueidentifier16
No
Foreign Keys FK_ContactMain_UserMain_CreatedBy: [dbo].[UserMain].CreatedByUserKeyIndexes IX_ContactMain_CreatedByUserKey: CreatedByUserKeyCreatedByUserKeyuniqueidentifier16
No
CreatedOndatetime8
No
TextOnlyEmailFlagbit1
No
((0))
Foreign Keys FK_ContactMain_ContactTypeRef: [dbo].[ContactTypeRef].ContactTypeKeyIndexes IX_ContactMain_ContactTypeKey: ContactTypeKeyContactTypeKeyuniqueidentifier16
No
OptOutFlagbit1
No
((0))
MarkedForDeleteOndatetime8
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_ContactMain: ContactKeyPK_ContactMainContactKey
Yes
AK_ContactMain_PrimaryMembershipGroupKeyPrimaryMembershipGroupKey
IX_ContactMain_AccessKeyAccessKey
IX_ContactMain_ContactStatusCodeContactStatusCode
IX_ContactMain_ContactTypeKeyContactTypeKey
IX_ContactMain_CreatedByUserKeyCreatedByUserKey
IX_ContactMain_FullNameFullName
IX_ContactMain_IDID
IX_ContactMain_IsInstituteContactKey, SyncContactID, ID, IsInstitute
IX_ContactMain_MajorKeyMajorKey
IX_ContactMain_SortNameSortName
IX_ContactMain_SyncContactIDSyncContactID
IX_ContactMain_TaxIDNumberTaxIDNumber
IX_ContactMain_UpdatedByUserKeyUpdatedByUserKey
Foreign Keys Foreign Keys
NameColumns
FK_ContactMain_AccessMainAccessKey->[dbo].[AccessMain].[AccessKey]
FK_ContactMain_AddressCategoryRef_PreferredPreferredAddressCategoryCode->[dbo].[AddressCategoryRef].[AddressCategoryCode]
FK_ContactMain_ContactStatusRefContactStatusCode->[dbo].[ContactStatusRef].[ContactStatusCode]
FK_ContactMain_ContactTypeRefContactTypeKey->[dbo].[ContactTypeRef].[ContactTypeKey]
FK_ContactMain_GroupMain_PrimaryMembershipPrimaryMembershipGroupKey->[dbo].[GroupMain].[GroupKey]
FK_ContactMain_UniformRegistryContactKey->[dbo].[UniformRegistry].[UniformKey]
FK_ContactMain_UserMain_CreatedByCreatedByUserKey->[dbo].[UserMain].[UserKey]
FK_ContactMain_UserMain_UpdatedByUpdatedByUserKey->[dbo].[UserMain].[UserKey]
Permissions
TypeActionOwning Principal
GrantDeleteIMIS
GrantInsertIMIS
GrantReferencesIMIS
GrantSelectIMIS
GrantUpdateIMIS
SQL Script
CREATE TABLE [dbo].[ContactMain]
(
[ContactKey] [uniqueidentifier] NOT NULL,
[ContactStatusCode] [nvarchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[FullName] [nvarchar] (110) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SortName] [nvarchar] (110) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[IsInstitute] [bit] NOT NULL,
[TaxIDNumber] [nvarchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[NoSolicitationFlag] [bit] NOT NULL,
[SyncContactID] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UpdatedOn] [datetime] NOT NULL CONSTRAINT [DF_ContactMain_UpdatedOn] DEFAULT (getdate()),
[UpdatedByUserKey] [uniqueidentifier] NOT NULL,
[IsIDEditable] [bit] NULL,
[ID] [nvarchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PreferredAddressCategoryCode] [int] NOT NULL,
[IsSortNameOverridden] [bit] NOT NULL CONSTRAINT [DF_ContactMain_IsSortNameOverridden] DEFAULT ((0)),
[PrimaryMembershipGroupKey] [uniqueidentifier] NULL,
[MajorKey] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AccessKey] [uniqueidentifier] NOT NULL,
[CreatedByUserKey] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[TextOnlyEmailFlag] [bit] NOT NULL CONSTRAINT [DF_ContactMain_TextOnlyEmailFlag] DEFAULT ((0)),
[ContactTypeKey] [uniqueidentifier] NOT NULL,
[OptOutFlag] [bit] NOT NULL CONSTRAINT [DF_ContactMain_OptOutFlag] DEFAULT ((0)),
[MarkedForDeleteOn] [datetime] NULL
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[ContactMain] ADD CONSTRAINT [PK_ContactMain] PRIMARY KEY CLUSTERED ([ContactKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ContactMain_AccessKey] ON [dbo].[ContactMain] ([AccessKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ContactMain_IsInstitute] ON [dbo].[ContactMain] ([IsInstitute]) INCLUDE ([ContactKey], [ID], [SyncContactID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ContactMain_ContactStatusCode] ON [dbo].[ContactMain] ([ContactStatusCode]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ContactMain_ContactTypeKey] ON [dbo].[ContactMain] ([ContactTypeKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ContactMain_CreatedByUserKey] ON [dbo].[ContactMain] ([CreatedByUserKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ContactMain_FullName] ON [dbo].[ContactMain] ([FullName]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ContactMain_ID] ON [dbo].[ContactMain] ([ID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ContactMain_MajorKey] ON [dbo].[ContactMain] ([MajorKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [AK_ContactMain_PrimaryMembershipGroupKey] ON [dbo].[ContactMain] ([PrimaryMembershipGroupKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ContactMain_SortName] ON [dbo].[ContactMain] ([SortName]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ContactMain_SyncContactID] ON [dbo].[ContactMain] ([SyncContactID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ContactMain_TaxIDNumber] ON [dbo].[ContactMain] ([TaxIDNumber]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ContactMain_UpdatedByUserKey] ON [dbo].[ContactMain] ([UpdatedByUserKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ContactMain] ADD CONSTRAINT [FK_ContactMain_AccessMain] FOREIGN KEY ([AccessKey]) REFERENCES [dbo].[AccessMain] ([AccessKey])
GO
ALTER TABLE [dbo].[ContactMain] ADD CONSTRAINT [FK_ContactMain_AddressCategoryRef_Preferred] FOREIGN KEY ([PreferredAddressCategoryCode]) REFERENCES [dbo].[AddressCategoryRef] ([AddressCategoryCode])
GO
ALTER TABLE [dbo].[ContactMain] ADD CONSTRAINT [FK_ContactMain_ContactStatusRef] FOREIGN KEY ([ContactStatusCode]) REFERENCES [dbo].[ContactStatusRef] ([ContactStatusCode])
GO
ALTER TABLE [dbo].[ContactMain] ADD CONSTRAINT [FK_ContactMain_ContactTypeRef] FOREIGN KEY ([ContactTypeKey]) REFERENCES [dbo].[ContactTypeRef] ([ContactTypeKey])
GO
ALTER TABLE [dbo].[ContactMain] ADD CONSTRAINT [FK_ContactMain_GroupMain_PrimaryMembership] FOREIGN KEY ([PrimaryMembershipGroupKey]) REFERENCES [dbo].[GroupMain] ([GroupKey])
GO
ALTER TABLE [dbo].[ContactMain] ADD CONSTRAINT [FK_ContactMain_UniformRegistry] FOREIGN KEY ([ContactKey]) REFERENCES [dbo].[UniformRegistry] ([UniformKey])
GO
ALTER TABLE [dbo].[ContactMain] ADD CONSTRAINT [FK_ContactMain_UserMain_CreatedBy] FOREIGN KEY ([CreatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
ALTER TABLE [dbo].[ContactMain] ADD CONSTRAINT [FK_ContactMain_UserMain_UpdatedBy] FOREIGN KEY ([UpdatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
GRANT REFERENCES ON  [dbo].[ContactMain] TO [IMIS]
GRANT SELECT ON  [dbo].[ContactMain] TO [IMIS]
GRANT INSERT ON  [dbo].[ContactMain] TO [IMIS]
GRANT DELETE ON  [dbo].[ContactMain] TO [IMIS]
GRANT UPDATE ON  [dbo].[ContactMain] TO [IMIS]
GO
Uses
Used By